package com.rybbaby.tss.front.tssMemberReturnPremiumHistory.dao.imp;

import com.rybbaby.tss.core.web.dao.imp.GenericDao;
import com.rybbaby.tss.front.tssMemberReturnPremiumHistory.dao.ITssMemberReturnPremiumHistoryDao;
import com.rybbaby.tss.front.tssMemberReturnPremiumHistory.entity.TssMemberReturnPremiumHistory;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description 会员退费记录表数据库操作实现
 * 
 * @author 雷春琼
 * 
 * @createDate 2017-08-10 上午12:14:02
 */
@Repository
public class TssMemberReturnPremiumHistoryDaoImp extends GenericDao<TssMemberReturnPremiumHistory> implements ITssMemberReturnPremiumHistoryDao {

    @Override
    public List<TssMemberReturnPremiumHistory> findByHistory(String refundId) throws Exception{
        String sql="SELECT\n" +
                "\ttss_member_return_premium_history.*,\n" +
                "\tsys_admin_user.userName As userName\n" +
                "FROM\n" +
                "\ttss_member_return_premium_history\n" +
                "LEFT JOIN sys_admin_user ON tss_member_return_premium_history.adminUserId = sys_admin_user.id\n" +
                "WHERE tss_member_return_premium_history.returnPremiumId = ?";
        List<TssMemberReturnPremiumHistory> listBySql = this.findListBySql(sql, TssMemberReturnPremiumHistory.class, refundId);
        return listBySql;
    }
}
